h=[10,30,70,80];
%% ͳ�Ʋв����ָ��
for i=1:4
    eval(['load data',num2str(h(i))]);
    m(i)=mae(e);
    r(i)=sqrt(mse(e));
    ma(i)=max(e);
    mi(i)=min(e);
end
%% ���Ʋ��Լ���MAE�Ƚ�ͼ
load data10_test
figure(1);
plot(e_origin,'-','linewidth',1.2);
hold on
plot(e_ar,'r-','linewidth',1.2);
hold on
plot(e_narx,'m-','linewidth',1.2);
% hold on
% plot(e_narxm,'k-.','Markersize',6);
% set(gca, 'FontSize', 30);
% hl=legend('Error-Origin','Error-AR(1)','Error-Narx');
% set(hl,'Orientation','horizon');
% set(hl,'Box','off');
xlim([1,96]);
ylabel('MAE(m/s)');
xlabel('Step');
title('10m');
set(gca,'FontName','Times New Roman','FontWeight','bold','Fontsize',14);
set(gca,'Ygrid','on');
% hl=legend('Origin data','AR(1)','Narx');
% set(hl,'Orientation','horizon');

load data30_test
figure(2);
plot(e_origin,'-','linewidth',1.2);
hold on
plot(e_ar,'r-','linewidth',1.2);
hold on
plot(e_narx,'m-','linewidth',1.2);
% hold on
% plot(e_narxm,'k-.','Markersize',6);
% set(gca, 'FontSize', 30);
% hl=legend('Error-Origin','Error-AR(1)','Error-Narx');
% set(hl,'Orientation','horizon');
% set(hl,'Box','off');
xlim([1,96]);
ylabel('MAE(m/s)');
xlabel('Step');
title('30m');
set(gca,'FontName','Times New Roman','FontWeight','bold','Fontsize',14);
set(gca,'Ygrid','on');
% hl=legend('Origin data','AR(1)','Narx');
% set(hl,'Orientation','horizon');

load data70_test
figure(3);
plot(e_origin,'-','linewidth',1.2);
hold on
plot(e_ar,'r-','linewidth',1.2);
hold on
plot(e_narx,'m-','linewidth',1.2);
% hold on
% plot(e_narxm,'k-.','Markersize',6);
% set(gca, 'FontSize', 30);
% hl=legend('Error-Origin','Error-AR(1)','Error-Narx');
% set(hl,'Orientation','horizon');
% set(hl,'Box','off');
xlim([1,96]);
ylabel('MAE(m/s)');
xlabel('Step');
title('70m');
set(gca,'FontName','Times New Roman','FontWeight','bold','Fontsize',14);
set(gca,'Ygrid','on');
% hl=legend('Origin data','AR(1)','Narx');
% set(hl,'Orientation','horizon');

load data80_test
figure(4);
plot(e_origin,'-','linewidth',1.2);
hold on
plot(e_ar,'r-','linewidth',1.2);
hold on
plot(e_narx,'m-','linewidth',1.2);
% hold on
% plot(e_narxm,'k-.','Markersize',6);
% set(gca, 'FontSize', 30);
% hl=legend('Error-Origin','Error-AR(1)','Error-Narx');
% set(hl,'Orientation','horizon');
% set(hl,'Box','off');
xlim([1,96]);
ylabel('MAE(m/s)');
xlabel('Step');
title('80m');
set(gca,'FontName','Times New Roman','FontWeight','bold','Fontsize',14);
set(gca,'Ygrid','on');
hl=legend('Origin data','AR(1)','Narx');
set(hl,'Orientation','horizon');

%% ���Ʋ��Լ���MAE�������ͼ
load data10_test
figure(1);
plot((1-e_ar./e_origin)*100,'linewidth',1.2);
hold on
plot((1-e_narx./e_origin)*100,'r-','linewidth',1.2);
hold on 
plot([1,96],[0,0],'--k','linewidth',1.2);
% hold on
% plot(e_narxm,'k-.','Markersize',6);
% set(gca, 'FontSize', 30);
% hl=legend('Error-Origin','Error-AR(1)','Error-Narx');
% set(hl,'Orientation','horizon');
% set(hl,'Box','off');
xlim([1,96]);
ylabel('Percentage improvement(%)');
xlabel('Step');
title('10m');
set(gca,'FontName','Times New Roman','FontWeight','bold','Fontsize',14);
set(gca,'Ygrid','on');
% hl=legend('AR(1)','Narx');
% set(hl,'Orientation','horizon');

load data30_test
figure(2);
plot((1-e_ar./e_origin)*100,'linewidth',1.2);
hold on
plot((1-e_narx./e_origin)*100,'r-','linewidth',1.2);
hold on 
plot([1,96],[0,0],'--k','linewidth',1.2);
% hold on
% plot(e_narxm,'k-.','Markersize',6);
% set(gca, 'FontSize', 30);
% hl=legend('Error-Origin','Error-AR(1)','Error-Narx');
% set(hl,'Orientation','horizon');
% set(hl,'Box','off');
xlim([1,96]);
ylabel('Percentage improvement(%)');
xlabel('Step');
title('30m');
set(gca,'FontName','Times New Roman','FontWeight','bold','Fontsize',14);
set(gca,'Ygrid','on');
% hl=legend('AR(1)','Narx');
% set(hl,'Orientation','horizon');

load data70_test
figure(3);
plot((1-e_ar./e_origin)*100,'linewidth',1.2);
hold on
plot((1-e_narx./e_origin)*100,'r-','linewidth',1.2);
hold on 
plot([1,96],[0,0],'--k','linewidth',1.2);
% hold on
% plot(e_narxm,'k-.','Markersize',6);
% set(gca, 'FontSize', 30);
% hl=legend('Error-Origin','Error-AR(1)','Error-Narx');
% set(hl,'Orientation','horizon');
% set(hl,'Box','off');
xlim([1,96]);
ylabel('Percentage improvement(%)');
xlabel('Step');
title('70m');
set(gca,'FontName','Times New Roman','FontWeight','bold','Fontsize',14);
set(gca,'Ygrid','on');
% hl=legend('AR(1)','Narx');
% set(hl,'Orientation','horizon');

load data80_test
figure(4);
plot((1-e_ar./e_origin)*100,'linewidth',1.2);
hold on
plot((1-e_narx./e_origin)*100,'r-','linewidth',1.2);
hold on 
plot([1,96],[0,0],'--k','linewidth',1.2);
% hold on
% plot(e_narxm,'k-.','Markersize',6);
% set(gca, 'FontSize', 30);
% hl=legend('Error-Origin','Error-AR(1)','Error-Narx');
% set(hl,'Orientation','horizon');
% set(hl,'Box','off');
xlim([1,96]);
ylabel('Percentage improvement(%)');
xlabel('Step');
title('80m');
set(gca,'FontName','Times New Roman','FontWeight','bold','Fontsize',14);
set(gca,'Ygrid','on');
hl=legend('AR(1)','Narx');
set(hl,'Orientation','horizon');







